angular.module('myApp', [])
.controller('LoginController', function ($scope, $http) {
          //user model define
         //ng-model="user.username"
         $scope.user = {}
         //ng-submit="login()"
         $scope.login = function () {
             console.log($scope.user)
             //Application.groovy post
             $http.post('/session', $scope.user).then(function (res) {
                 console.log(res.data)
                 if (res.status == "SUCCESS") {
                     console.log('登录成功');
                     //code
                 }
             }, function (reason) {
                 //{{info}}
                 $scope.info = reason.data;
             })
         }
 });